void CLeftView::OnInitialUpdate()
{
	CTreeView::OnInitialUpdate();

	// TODO: You may populate your TreeView with items by directly accessing
	//  its tree control through a call to GetTreeCtrl().
    // ͼб
	m_ImageList.Create( 20, 20, ILC_COLOR16, 4, 1 );

    //ͼб4ͼ
    m_ImageList.Add(AfxGetApp()->LoadIcon(IDI_CAR1));
    m_ImageList.Add(AfxGetApp()->LoadIcon(IDI_CAR2) );
    m_ImageList.Add(AfxGetApp()->LoadIcon(IDI_CAR3) );
    m_ImageList.Add(AfxGetApp()->LoadIcon(IDI_CAR4) );

    //ȡTreeؼָͼm_ImageListȡ
	CTreeCtrl &m_TreeCtrl = GetTreeCtrl();
	m_TreeCtrl.SetImageList( &m_ImageList, TVSIL_NORMAL );

	HTREEITEM hItem0, hItem1, hItem2;
	TV_INSERTSTRUCT tvstruct;

	tvstruct.hParent=NULL;
	tvstruct.item.lParam=0;
	tvstruct.item.mask=TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_TEXT|TVIF_PARAM;
	tvstruct.item.iImage=0;
	tvstruct.item.iSelectedImage=0;
	tvstruct.item.pszText = "0000 вƷ";
	hItem0 = m_TreeCtrl.InsertItem(&tvstruct);

	CDatabase db;
	CCpbmSet* pCpbmSet = new CCpbmSet(&db);

	pCpbmSet->m_strSort = "fCpbm ASC";
	if(!pCpbmSet->IsOpen())
		pCpbmSet->Open();
	if(!pCpbmSet->IsBOF())
		pCpbmSet->MoveFirst();
	while(!pCpbmSet->IsEOF())
	{
		CString strTemp1 = pCpbmSet->m_fcpbm;
		CString strTemp2 = pCpbmSet->m_fcpmc;
		strTemp1.TrimLeft();
		strTemp1.TrimRight();
		strTemp2.TrimLeft();
		strTemp2.TrimRight();
		CString strTemp = strTemp1 + " " + strTemp2;

        if(strTemp1.Right(3) == "000")
		{
			tvstruct.hParent = hItem0;
			tvstruct.item.lParam = 1;
			tvstruct.item.iImage=1;
			tvstruct.item.iSelectedImage=1;
			tvstruct.item.pszText = (LPTSTR)(LPCTSTR)strTemp;
			hItem1 = m_TreeCtrl.InsertItem(&tvstruct);
		}
		else if(strTemp1.Right(2) == "00")
		{
			tvstruct.hParent = hItem1;
			tvstruct.item.lParam = 2;
			tvstruct.item.iImage=2;
			tvstruct.item.iSelectedImage=2;
			tvstruct.item.pszText = (LPTSTR)(LPCTSTR)strTemp;
			hItem2 = m_TreeCtrl.InsertItem(&tvstruct);
		}
		else
		{
			tvstruct.hParent = hItem2;
			tvstruct.item.lParam = 3;
			tvstruct.item.iImage=3;
			tvstruct.item.iSelectedImage=3;
			tvstruct.item.pszText = (LPTSTR)(LPCTSTR)strTemp;
			m_TreeCtrl.InsertItem(&tvstruct);
		}
			
		pCpbmSet->MoveNext();
	}

	pCpbmSet->Close();
	delete pCpbmSet;
}
